feat: add get_issues method to Repository#95
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds get_issues and get_issue_comments methods to the Repository class, along with corresponding unit tests. The feedback suggests improving type safety by using a Literal type instead of a generic str for the state parameter in get_issues to restrict its allowed values.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Code Review
This pull request adds get_issues and get_issue_comments methods to the Repository class, along with corresponding unit tests, and bumps the package version. The feedback suggests enhancing type safety for the state parameter in get_issues by using Literal instead of str to restrict it to valid values.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| """List pull requests in this repository.""" | ||
| return self._extract_all(url=self._url_pull, n=n) | ||
|
|
||
| def get_issues(self, state: str = "all", n: int = 0) -> list[dict[str, Any]]: |
There was a problem hiding this comment.
To align with the repository's emphasis on type safety (using pyright and ty), we should restrict the state parameter to the specific allowed values ("open", "closed", "all") using Literal instead of a generic str. This provides better IDE autocompletion and static analysis checks.
Note: Please ensure Literal is imported from typing.
def get_issues(
self, state: Literal["open", "closed", "all"] = "all", n: int = 0
) -> list[dict[str, Any]]:References
- Type Safety: Uses ty and pyright to ensure type correctness. (link)
2f8ce1a to
6a0cd4d
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for retrieving issues and issue comments from a GitHub repository by introducing the IssueState enum, get_issues, and get_issue_comments methods, along with corresponding unit tests. The review feedback suggests ensuring StrEnum is imported to prevent a runtime NameError and recommends typing the state parameter as IssueState | str to allow callers to pass raw strings directly for better usability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
get_issuesmethod toRepositoryChanged files
Modified
github_rest_api/github.py(+18/-0)tests/test_github.py(+19/-0)uv.lock(+1/-1)Commits
get_issuesmethod toRepository